local scene = director:createScene()

function scene:setUp(event)
    dbg.print("sceneInstructions:setUp")
			
	local allScaleX = 480/director.displayWidth
	local allScaleY = 320/director.displayHeight
	
	local labelInstructionsOne = director:createLabel({x=240/allScaleX, y=290/allScaleY, hAlignment="center", xAnchor=0.5, color= color.white, xScale=1/allScaleX, yScale=1/allScaleY,})
	local labelInstructionsTwo = director:createLabel({x=240/allScaleX, y=260/allScaleY, hAlignment="center", xAnchor=0.5, color= color.white, xScale=1/allScaleX, yScale=1/allScaleY,})
	local labelInstructionsThree = director:createLabel({x=240/allScaleX, y=230/allScaleY,hAlignment="center", xAnchor=0.5, color= color.white, xScale=1/allScaleX, yScale=1/allScaleY,})
	local labelInstructionsFour = director:createLabel({x=240/allScaleX, y=200/allScaleY,hAlignment="center", xAnchor=0.5, color= color.white, xScale=1/allScaleX, yScale=1/allScaleY,})
	local labelInstructionsFive = director:createLabel({x=240/allScaleX, y=170/allScaleY,hAlignment="center", xAnchor=0.5, color= color.white, xScale=1/allScaleX, yScale=1/allScaleY,})
	local labelInstructionsSix = director:createLabel({x=240/allScaleX, y=140/allScaleY,hAlignment="center", xAnchor=0.5, color= color.white, xScale=1/allScaleX, yScale=1/allScaleY,})
	local labelInstructionsSeven = director:createLabel({x=240/allScaleX, y=110/allScaleY,hAlignment="center", xAnchor=0.5, color= color.white, xScale=1/allScaleX, yScale=1/allScaleY,})
	
	labelInstructionsOne.text="Instructions:"
	labelInstructionsTwo.text=" "
	labelInstructionsThree.text="Your mission is to dunk"
	labelInstructionsFour.text="the ball in the shortest"
	labelInstructionsFive.text="time possible,"
	labelInstructionsSix.text="score possible."
	labelInstructionsSeven.text="you have ten attempts."

		
	local buttonBack = director:createSprite(250/allScaleX, 50/allScaleY, "img/button.png")
	buttonBack.xAnchor=0.5; buttonBack.yAnchor=0.5
	buttonBack.xScale=.5/allScaleX; buttonBack.yScale=.5/allScaleY 
	buttonBack.y = buttonBack.y - buttonBack.h/2.5/allScaleY
	labelBack = director:createLabel(250/allScaleX, 0, "Back")
	labelBack.xAnchor=0.5;
	labelBack.zOrder = buttonBack.zOrder
	labelBack. hAlignment="center"
	labelBack.xScale = 1/allScaleX
	labelBack.yScale = 1/allScaleY
	
	function buttonBack:touch(event)
		if (event.phase == 'began') then
			system:sendEvent("moveToSceneMenu")
		end
	end
	buttonBack:addEventListener('touch', buttonBack)
end

function scene:tearDown(event)
    dbg.print("sceneInstructions:tearDown")
end

scene:addEventListener({"setUp", "tearDown"}, scene)

return scene